/*************************************************************************
	> File Name: fork.c
	> Author: Angel Criss
	> Blog: blog.abbycin.tk 
	> Created Time: Sun 06 Jul 2014 02:39:56 PM CST
 ************************************************************************/

#include"head.h"

static int out=10;
main()
{
    pid_t child;

    int in=10;

    switch(child=fork()){
        case -1:
            err("fork");
        case 0:
            out*=3;
            in*=3;
            //for(;;); //zombie
            break;
        default:
            sleep(3);
            break;
    }
    printf("PID: %ld %s; out: %d ; in: %d\n",(long)getpid(),(child==0)?"(child)":"(parent)",out,in);
}
